package com.dj.mingkong.portal.biz.repository.database.music;

import com.dj.mingkong.common.infrastructure.base.dto.query.QueryVo;
import com.dj.mingkong.common.infrastructure.base.repository.BaseDatabaseRepository;
import com.dj.mingkong.common.infrastructure.eo.database.music.AlbumCollectEo;
import com.dj.mingkong.portal.biz.repository.database.music.mapper.AlbumCollectMapper;
import org.springframework.stereotype.Repository;

import java.util.Optional;

/**
 * 专辑收藏Repository
 *
 * @author zenglonghui
 * @date: 2022/5/17 19:14
 */
@Repository
public class AlbumCollectRepository extends BaseDatabaseRepository<AlbumCollectMapper, AlbumCollectEo, QueryVo> {
    public Optional<AlbumCollectEo> oneOptByUserIdAndAlbumId(Long userId, Long albumId) {
        return lambdaQuery()
                .eq(AlbumCollectEo::getUserId, userId)
                .eq(AlbumCollectEo::getAlbumId, albumId).oneOpt();
    }
}
